import { ref } from "vue";
import { defineStore } from "pinia";

export const useAddrStore = defineStore("addr", () => {
  let addrList = ref([
    {
      id: "1",
      name: "张三",
      tel: "13000000000",
      address: "贵州省贵阳市云岩区延安东路物资大厦9楼千锋校区",
      // 默认字样
      isDefault: true,
      areaCode: "520103",
      addressDetail: "延安东路物资大厦9楼千锋校区",
    },
  ]);

  let defaultAddr = ref([
    {
      name: "张三",
      tel: "13000000000",
      areaCode: "520103",
      addressDetail: "延安东路物资大厦9楼千锋校区 ",
      isDefault: false,
      address: "贵州省贵阳市云岩区延安东路物资大厦9楼千锋校区",
    },
  ]);

  // 向外面暴露
  return {
    addrList,
    defaultAddr,
  };
});
